package com.song.controller;

import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

/**
 * @Author Klys
 * @Date 2022/3/20 20:48
 * @Version 1.0
 */
@Controller
@Slf4j
public class zk_Consumer_Controller {

    public static final String ZK_INVOKE_URL="http://localhost:9001";

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/zk/consume/get")
    @ResponseBody
    public String test(){
        return restTemplate.getForObject(ZK_INVOKE_URL+"/zk/provider01",String.class);
    }
}
